﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

using Weazel.Badger.Vhdl.Types;

namespace Weazel.Badger.Vhdl.Operators.Unary
{
  public class StdLogicVectorConversion : ConversionBase
  {
    private static UnaryTypeMap[] typeMaps = new UnaryTypeMap[]
      {
        new UnaryTypeMap(Types.Types.Signed, Types.Types.StdLogicVector),
        new UnaryTypeMap(Types.Types.Unsigned, Types.Types.StdLogicVector),
        new UnaryTypeMap(Types.Types.Integer, Types.Types.StdLogicVector),
        new UnaryTypeMap(Types.Types.StdLogicVector, Types.Types.StdLogicVector)
      };

    public override UnaryTypeMap[] TypeMap
    {
      get
      {
        return typeMaps;
      }
    }

    public StdLogicVectorConversion(int width, Types.Type from) : base(width, from)
    {      
    }

    public override string ToString(string expression)
    {      
      return string.Format("conv_std_logic_vector({0}, {1})", expression, Width);
    }
  }
}
